const {resolve} =require('path');
const HtmlWebpackPlugin =require('html-webpack-plugin')
const MiniCssExtractPlugin =require('mini-css-extract-plugin')

module.exports={
    entry:'./src/js/index.js',
    output:{
        filename:'js/build.js',
        path:resolve(__dirname,'build')
    },
    module:{
        rules:[{
            test:/\.css$/,
            use:[
                // 'style-loader',
                MiniCssExtractPlugin.loader,
                 'css-loader'
            ]  
        }]
    },
    plugins:[
        new HtmlWebpackPlugin({
            template:'./src/index.html'
        }),
        new MiniCssExtractPlugin()
    ],
    mode:'development'

}

